<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
        <meta name="format-detection" content="telephone=no,email=no,adress=no" />
        <META HTTP-EQUIV="luxiaoqing" CONTENT="no-cache">

        <title>69圈城-商家</title>
        
        <jsp:include page="../lbi/merCommon.jsp"></jsp:include>
    </head>
    <style>
		.bianhao{float: left; padding: 20px 20px 20px 40px;}
		.tex{float:left;margin:20px auto;}
		.tex textarea{padding:2px 2px;}
		.tex p{color: #9FA0A0; padding-top: 5px;}
	</style>
    <body>
        <!--头部-->
        <div class="business_top">
            <jsp:include page="../lbi/merHead.jsp"></jsp:include>

            <div class="clear"></div>
        </div>
        <!--头部end-->

        <div class="clear4"></div>

        <!--中间-->
        <div class="individual_form-center">
        
            <input type="hidden" id="shopId" value="${shopId }">
        
            <!--左边导航部分-->
            <jsp:include page="../lbi/merLeft.jsp"></jsp:include>
            <!--左边导航部分end-->

            <!--右边详情部分-->
            <div class="individual_form-center-right">
                <!--所在位置-->
                <div class="individual_form-center-right-position">
                    <span class="span01">商家优惠</span>

                    <span class="span01">></span>

                    <span class="span01">发布记录</span>
                </div>
                <!--所在位置end-->

                <div class="clear"></div>
                    
                    <div class="individual_form-center-right-details">
	                    <div class="individual-form-discount_record">
	                        <div class="clear2"></div>
	
	                        <div class="hexiao">
	                            <span class="bianhao">
	                                优惠券编号:
	                            </span>
	                            <span class="tex">
	                                <textarea cols="50" rows="10" id="couponNumber" name="couponNumber"></textarea>
	                                <p>*每个编号请以逗号隔开</p>
	                            </span>
	                            
	                        </div>
	
	                        <div class="clear2"></div>
	                        <div class="individual-form-set_phone-form-sub" style="margin-left: 130px;">
	                            <input type="button" value="核&nbsp;&nbsp;&nbsp;&nbsp;销" id='submit_btn' />
	                        </div>
	                    </div>
                    </div>
                
            </div>
            <!--右边详情部分end-->

            <div class="clear2"></div>
        </div>
        <!--中间end-->

        <div class="clear2"></div>

        <!--底部-->
        <div class="business_foot">
            <jsp:include page="../lbi/merFooter.jsp"></jsp:include>
        </div>
        <!--底部end-->

        <div class="clear8"></div>
        
        <script>
            $("#yhj_hx").addClass("individual_form-center-left-nav-demo-02_dj");
        
            var _serviceURL = '/69mark/merchant';// 必须设置
            
            $("#submit_btn").click(function(){
            	
            	var shopId = $("#shopId").val();
                var couponNumber = $("#couponNumber").val();
                 $.ajax({
                     type : "POST",
                     url : _serviceURL+"/toUpdateDestroy.do",
                     cache : false,
                     data : "shopId="+shopId+"&couponNumber="+couponNumber,
                     dataType : 'json',
                     success : function(data) {
                         if (data == 1) {
                        	 alert("核销成功");
                        	 $("#couponNumber").val("");
                         }else if (data == 2) {
                        	 alert("优惠券编号不存在");
                         }else{
                        	 alert("修改失败，请联系管理员");
                         }
                     }
                 })
            });

            
           
        </script>
    </body>

</html>